<?php

namespace App\Http\Controllers;

use App\Models\Record;
use Illuminate\Http\Request;

class RecordController extends Controller
{
    //

    public function index(Request $request)
    {
        $user_id = $request->get('user_id');
        $pageIndex = $request->get('pageIndex');
        $pageSize = $request->get('pageSize');

        $records = Record::query()
            ->where('user_id', $user_id)
            ->paginate($pageSize, ['*'], 'pageIndex', $pageIndex);

        return $this->response($records);
    }
}
